﻿using System;
using $DomainProjectName$.Repositories;
using DDDProject.Aspects;

namespace $DomainProjectName$
{
    /// <summary>
    /// Example of entity class
    /// </summary>
    public class ExampleEntity : Entity
    {
        /// <summary>
        /// Example of a repository injected into the entity, thanks to AOP.
        /// You are not forced to use this design : if you don't like the injection of
        /// components into entities, don't use the [InjectComponent] aspect and remove
        /// references to DDDProject.Aspects and Postsharp libraries.
        /// </summary>
        [InjectComponent]
        private IExampleEntityRepository _exampleEntityRepository;

        private string _myEntityField = String.Empty;

        public ExampleEntity()
        {
        }

        /// <summary>
        /// Example of entity field
        /// </summary>
        public virtual string MyEntityField
        {
            get 
            {
                return _myEntityField;
            }
        }
    }
}
